The present invention relates generally to the field of digital computers, and in particular, relates to apparatus for controlling computer graphics displays.
An important application of computer graphics involves the creation of realistic images of three dimensional objects. Designers of three dimensional objects such as automobiles, aircraft, and buildings may want to see how a preliminary design will look. Creating realistic computer-generated images is an easier, less expensive, and more effective method of seeing preliminary results than building models and prototypes. Computer generated images allows a greater number of alternative designs to be considered in a shorter time. Often, the design work itself is performed on a computer system, using a computer-aided design (CAD) or other engineering workstation. In such a case, a digitized representation of the three dimensional object is already available to use as the basis for the computer generated image.
Simulation systems are another application for computer generated three dimensional images. Such systems present images which not only must appear realistic, but which also change dynamically.
One approach which helps produce visual realism in computer generated images is shading of surfaces. Variations in surface shading add visual information of the type normally found in a visual environment, so that an observer's depth perception mechanisms can properly resolve any ambiguities caused when three dimensional objects are projected into two dimensions.
Computer image generation systems often represent curved surfaces as a mesh of planar polygons that are shaded to restore a smooth appearance. Most computer image generation systems represent curved surfaces as a mesh of planar polygons because polygons can be transformed quickly with well known algorithms. Because the polygonal representation is an artifact of the image generation method, and is not of interest to a viewer, image generating systems attempt to restore a smooth appearance to surfaces thus represented by varying the intensity across polygons. This shading operation is performed for one million or more pixels per image, and thus its efficiency is crucial to the performance of the image generating system.
A variety of shading models and shading methods are used in computer graphics systems to shade surfaces. Shading models attempt to describe the reflection characteristics of a surface, and shading methods are used in conjunction with shading models to calculate intensity values for pixels constituting a computer generated image of a surface. Conventional shading methods include constant or "flat" shading, linear interpolation shading, (typically referred to as Gouraud shading), and normal-vector interpolation shading (typically referred to as Phong shading).
These shading methods are discussed generally in "Fundamentals of Interactive Computer Graphics," Foley, Van Dam, Addison-Wesley, 1984, which is incorporated herein by reference. In particular, linear interpolation shading is discussed in Gouraud, "Continuous Display of Curved Surfaces," Ph. D. Dissertation, Department of Computer Science, University of Utah, Salt Lake City, June, 1971, incorporated herein by reference. Normal-vector interpolation shading is discussed in Phong, "Illumination for Computer-Generated Images," Ph. D. Dissertation, Department of Electrical Engineering, University of Utah, Salt Lake City, July, 1973, also incorporated herein by reference.
Constant shading calculates a single intensity value for shading an entire surface. The major deficiency of constant shading is that when applied to the polygon meshes typically employed in computer graphics to represent curved surfaces, constant shading produces a set of polygons resembling flat facets.
The most commonly used shading method in real-time image generation systems is linear interpolation shading, or Gouraud shading. Gouraud shading computes the intensity at each point by linear interpolation of the intensities at the vertices. The method is widely used in real-time systems because it produces shaded images of acceptable quality with only one addition per pixel.
Linear interpolation shading, or Gouraud shading, eliminates intensity discontinuities, but does not eliminate discontinuities in the first derivative, or slope, of the intensity curve at the edges of adjacent polygons. Linear interpolation shading thus produces Mach bands, or pronounced apparent intensity changes at the edges of adjacent polygons.
Normal-vector interpolation shading, or Phong shading, interpolates surface normal vectors, rather than intensity, across a polygon. The surface normal vector is interpolated between starting and ending normals which are themselves interpolations along the edges of the polygon. At each pixel along a scan line, a new intensity calculation is performed. Phong shading reduces Mach band problems, because an approximation to the normal vector is used at each point, but greatly increases the cost of the shading, because a complete intensity calculation is performed at each pixel.
In order to completely remove Mach band effects, the color or intensity at the edges of adjacent polygons approximating a curved surface must be the same, and the first derivative of the color with respect to screen coordinate axes x and y must also be the same. Higher order interpolation can yield better results than linear interpolation.
There exists a need for a computer graphics shading system which can provide realistic shading of regions, while maintaining low cost, low complexity, and high processing speed. A shading system implementing second order, or quadratic, interpolation could provide realistic shading at low cost.
It is thus an object of the invention to provide an improved computer graphics display controller system.
It is a further object of the invention to provide an improved system for shaded image generation.
It is another object of the invention to provide a system for executing quadratic interpolation so that the first derivative of color at the edges and vertices of polygons tends toward being continuous.
It is yet another object of the invention to provide an efficient and inexpensive system for shaded image generation, utilizing quadratic and higher order interpolation.